<template>
  <view class="pagination-container">
    <view 
      class="pagination-btn" 
      :class="{ disabled: currentPage === 1 }"
      @click="handlePrev"
    >
      <uni-icons type="left" size="16" color="#000"></uni-icons>
    </view>
    
    <view class="pagination-info">
      第 {{ currentPage }} 页 / 共 {{ totalPages }} 页
    </view>
    
    <view 
      class="pagination-btn" 
      :class="{ disabled: currentPage === totalPages }"
      @click="handleNext"
    >
      <uni-icons type="right" size="16" color="#999"></uni-icons>
    </view>
  </view>
</template>

<script>
export default {
  props: {
    currentPage: {
      type: Number,
      required: true
    },
    totalPages: {
      type: Number,
      required: true
    }
  },
  methods: {
    handlePrev() {
      if (this.currentPage > 1) {
        this.$emit('page-change', this.currentPage - 1);
      }
    },
    handleNext() {
      if (this.currentPage < this.totalPages) {
        this.$emit('page-change', this.currentPage + 1);
      }
    }
  }
}
</script>

<style scoped>
.pagination-container {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 60rpx;
  padding: 20rpx 0;
}

.pagination-btn {
  width: 80rpx;
  height: 80rpx;
  border-radius: 50%;
  background-color: var(--primary-light);
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0 30rpx;
  cursor: pointer;
  transition: all 0.3s ease;
}

.pagination-btn:hover:not(.disabled) {
  background-color: var(--primary-color);
}

.pagination-btn.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.pagination-info {
  font-size: 28rpx;
  color: var(--text-medium);
}
</style>  